﻿import plugin from "../../lib/plugins/plugin.js"

let rulePrefix = '((#|\\*)(星铁|星轨|崩铁|星穹铁道|铁道|sr)|\\*|＊)'
export class yzlscl extends plugin {
    constructor() {
        super({
            name: "部分帮助特殊处理",
            dsc: "部分帮助特殊处理",
            event: "message",
            priority: 10,
            rule: [
                {
                    reg: "^#?(记录帮助|抽卡帮助)$",
                    fnc: "help"
                },
                {
                    reg: "^#?(安卓|苹果|电脑|pc|ios)帮助$",
                    fnc: "helpPort"
                },
                {
                    reg: '^#?(体力|[Cc](oo)?[Kk](ie)?)帮助',
                    fnc: 'ckHelp'
                },
                {
                    reg: `^${rulePrefix}(记录帮助|抽卡帮助)$`,
                    fnc: 'srhelp'
                },
                {
                    reg: `^${rulePrefix}更新抽卡记录$`,
                    fnc: 'srcha'
                }
            ]
        })
    }

    help() {
        this.e.reply(`请使用【#更新抽卡记录】更新抽卡记录`)
      }
    
    helpPort() {
        let msg = this.e.msg.replace(/#|帮助/g, "")
    
        if (["电脑", "pc"].includes(msg)) {
            this.e.reply(`请使用【#更新抽卡记录】更新抽卡记录`, true)
        } else if (["安卓"].includes(msg)) {
            this.e.reply(`请使用【#更新抽卡记录】更新抽卡记录`, true)
        } else if (["苹果", "ios"].includes(msg)) {
            this.e.reply(`请使用【#更新抽卡记录】更新抽卡记录`, true)
        }
    }
    
    async ckHelp() {
        await this.reply(`请使用【#扫码登陆】进行绑定`, true)
    }

    async srhelp(){
        await this.reply(`请使用下面教程获取链接\n\n【腾讯文档】通过网页云星铁便捷获取抽卡链接https://docs.qq.com/doc/DWmhNd1lubXdET0dM\n\n获取完链接发送至群聊或频道即可`, true)
    }

    async srcha(){
        await this.reply(`暂不支持通过【*更新抽卡记录】获取链接进行更新\n\n请前往下面文档查询获取链接发送至群聊或频道进行更新抽卡记录\n\n【腾讯文档】通过网页云星铁便捷获取抽卡链接https://docs.qq.com/doc/DWmhNd1lubXdET0dM`, true)
    }
}